<template>
  <div class="detail">
    <el-page-header @back="$router.go(-1)" :content="$route.meta.title"></el-page-header>
    <div class="h2">个人完税证明详情</div>
    <div class="section">
        <el-table
        :data="tableData1"
        style="width: 100%">
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="id"
          label="编号">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="bill_no"
          label="结算单号">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="time_add"
          :formatter="formatTime"
          label="导入时间">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="title"
          label="企业名称">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="name"
          label="创客姓名">
        </el-table-column>
        <el-table-column
          align="center"
          prop="wage"
          label="总金额">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="tax_should"
          label="应缴税所得额">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="addvalue_tax"
          label="增值税">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="city_tax"
          label="城市税">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="edu_tax"
          label="教育税">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="local_edu_tax"
          label="地方教育税">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="in_income_tax"
          label="个人所得税">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="water_tax"
          label="水利税">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="stamp_tax"
          label="印花税">
        </el-table-column>
      </el-table>
    </div>
    <div class="h2">个人完税证明汇总</div>
    <div class="section">
        <el-table
        :data="tableData1"
        style="width: 100%">
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="order_num"
          label="申请笔数">
        </el-table-column>
        <el-table-column
          align="center"
          prop="wage"
          label="总金额">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="tax_should"
          label="应缴税所得额">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="addvalue_tax"
          label="增值税">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="city_tax"
          label="城市税">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="edu_tax"
          label="教育税">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="local_edu_tax"
          label="地方教育税">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="in_income_tax"
          label="个人所得税">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="water_tax"
          label="水利税">
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          prop="stamp_tax"
          label="印花税">
        </el-table-column>
      </el-table>
    </div>
    <div class="h2">个人完税证明</div>
    <img class="pic" :src="tax_prove | checkurl" alt="">
  </div>
</template>
<script>
import { dateFormat } from '@/common/js/utils'
export default {
  name: 'detail',
  data() {
    return {
      tableData1: [],
      tax_prove: ''
    }
  },
  methods: {
    formatTime(row, column) {
      let value = row[column.property]
      if (typeof value === 'string' && value.indexOf('-') > -1) {
        return value
      }
      if (value) {
        return dateFormat('YYYY-mm-dd HH:MM:SS', value)
      }
      return '--'
    },
    getInfo() {
      this.$http.get('/personal/bill-personal/info', {
        id: this.$route.query.id
      }).then(res => {
        if (res.status === 1) {
          this.tableData1 = [res.data.info]
          this.tax_prove = res.data.info.tax_prove
        }
      })
    }
  },
  mounted() {
    this.getInfo()
  }
}
</script>
<style lang="less" scoped>
.pic {
  width: 500px;
}
</style>